/**
 *  利用链表的后续遍历，使用函数调用栈作为后序遍历栈，来判断是否回文
 */

 var isPalindrome = function(head) {
    let left = head;
    function traverse(right) {
        if (right == null) return true;
        let res = traverse(right.next);
        res = res && (right.val === left.val);
        left = left.next;
        return res;
    }
    return traverse(head);
};


